package com.cloud.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cloud.system.entity.SysMonitor;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 服务监控配置
 *
 * @author yzj
 * @since 2022-10-25
 */
@Mapper
public interface SysMonitorMapper extends BaseMapper<SysMonitor> {

    /**
     * 监控配置分页
     *
     * @author yzj
     */
    public List<SysMonitor> selectSysMonitorList(@Param("param") SysMonitor param);

    /**
     * 查询项目应用服务列表
     *
     * @param isApply
     * @return
     */
    public List<SysMonitor> selectProjectMonitorList(@Param("isApply") Integer isApply);

    /**
     * 查询服务名称是否存在
     *
     * @param serviceName
     * @return
     */
    public int checkServiceNameUnique(@Param("serviceName") String serviceName);

    /**
     * 根据主键修改服务状态
     *
     * @param status
     * @param monitorId
     * @return
     */
    public int updateServiceStatus(@Param("status") String status, @Param("monitorId") Long monitorId);

    /**
     * 根据主键查询配置信息
     *
     * @param monitorId
     * @return
     */
    public SysMonitor selectMonitorinfo(@Param("monitorId") Long monitorId);

}
